<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<meta http-equiv="Cache-Control" content="no-siteapp" />

    <title>xmake v2.3.1 发布, 无缝对接其他构建系统</title>
    <meta name="description" content="最近对xmake内部做了不少的重构来改进，并且新增了不少实用的新特性，欢迎来体验。  项目源码  官方文档一些新特性：  一键编译其他构建系统维护的项目，实现无缝对接，并且支持交叉编译（比如autotools的快速交叉编译，见下文详述）  新增xmake project -k ninja工程生成插件，支持对bui...">

    
    <meta name="keywords" content="xmake,lua,C/C++,autotools,cmake,ninja,mingw,msys,tboox" /> 

    <!-- qq oauth -->
    <meta property="qc:admins" content="5211601217706727767255" />

    <!--icon -->
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="icon" sizes="192x192" href="/static/img/nice-highres.png" />
	<link rel="apple-touch-icon-precomposed" href="/static/img/apple-touch-icon-57x57-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="72x72" href="/static/img/apple-touch-icon-72x72-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="114x114" href="/static/img/apple-touch-icon-114x114-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/static/img/apple-touch-icon-144x144-precomposed.png" />
	<link rel="apple-touch-icon-precomposed" sizes="180x180" href="/static/img/retinahd_icon.png" />
	<meta name="msapplication-TileImage" content="/static/img/retinahd_icon.png" />
	
    <link rel="stylesheet" href=" /css/fontawesome/css/font-awesome.min.css ">
    <link rel="stylesheet" href=" /css/main.css ">
    <link rel="canonical" href="https://tboox.org/cn/2020/02/23/xmake-update-v2.3.1/">
    <link rel="alternate" type="application/rss+xml" title="TBOOX Open Source Project" href="https://tboox.org/feed.xml ">
    <link rel="alternate" hreflang="en" href="https://tboox.org/" />
    <link rel="alternate" hreflang="zh-Hans" href="https://tboox.org/cn/" />

    <!-- css -->
    <link href="/css/reward.css" rel="stylesheet" type="text/css"> 




    <script type="text/javascript">
    function isPC(){    
        var userAgentInfo = navigator.userAgent;  
        var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");    
        var flag = true;    
        for (var v = 0; v < Agents.length; v++) {    
            if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }    
        }    
        return flag;    
    }
    </script>

<!-- baidu ads -->



    <!-- baidu ads -->

</head>


  <body>

    <header id="top">
    <div class="wrapper">
        <a href="/cn" class="brand">TBOOX</a>
        <button id="headerMenu" class="menu"><i class="fa fa-bars"></i></button>
        <nav id="headerNav">
            <ul>
                <li>
                    
                    <a href="/?lang=0">
                    
                        <i class="fa fa-home"></i>English
                    </a>
                </li>

                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/project/">
                            
                        
                            <i class="fa fa-bookmark"></i>项目
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/archive/">
                            
                        
                            <i class="fa fa-archive"></i>归档
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/category/">
                            
                        
                            <i class="fa fa-th-list"></i>分类
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/tag/">
                            
                        
                            <i class="fa fa-tags"></i>标记
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/docs/">
                            
                        
                            <i class="fa fa-book"></i>文档
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="https://xmake.io/#/zh-cn/about/contact" target="_blank" >
                            
                        
                            <i class="fa fa-forumbee"></i>社区
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/donation/">
                            
                        
                            <i class="fa fa-heart"></i>捐助
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                    
                    <li>
                        
                            
                            <a href="/cn/about/">
                            
                        
                            <i class="fa fa-user"></i>关于
                        </a>
                    </li>
                    
                    
                
                    
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                    
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            </ul>
        </nav>
    </div>
</header>



        <div class="page clearfix" post>
    <div class="left">
        <h1>xmake v2.3.1 发布, 无缝对接其他构建系统</h1>
        <div class="label">

            <div class="label-card">
                <i class="fa fa-calendar"></i>2020-02-23
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
                
            </div>

            <div class="label-card">
            


<!-- <span class="point">•</span> -->
<span class="categories">
  <i class="fa fa-th-list"></i>
  
    
        <a href="/category/#xmake" title="Category: xmake" rel="category">xmake</a>
    
  

  <!-- <span class="point">•</span> -->
</span>


            </div>

            <div class="label-card">
            
<!-- <span class="point">•</span> -->
<span class="pageTag">
  <i class="fa fa-tags"></i>
  
    
        <!--a href="/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a-->
        <a href="/cn/tag/#xmake" title="Tag: xmake" rel="tag">xmake</a>&nbsp;
    
        <!--a href="/tag/#lua" title="Tag: lua" rel="tag">lua</a-->
        <a href="/cn/tag/#lua" title="Tag: lua" rel="tag">lua</a>&nbsp;
    
        <!--a href="/tag/#C%2FC%2B%2B" title="Tag: C/C++" rel="tag">C/C++</a-->
        <a href="/cn/tag/#C/C++" title="Tag: C/C++" rel="tag">C/C++</a>&nbsp;
    
        <!--a href="/tag/#autotools" title="Tag: autotools" rel="tag">autotools</a-->
        <a href="/cn/tag/#autotools" title="Tag: autotools" rel="tag">autotools</a>&nbsp;
    
        <!--a href="/tag/#cmake" title="Tag: cmake" rel="tag">cmake</a-->
        <a href="/cn/tag/#cmake" title="Tag: cmake" rel="tag">cmake</a>&nbsp;
    
        <!--a href="/tag/#ninja" title="Tag: ninja" rel="tag">ninja</a-->
        <a href="/cn/tag/#ninja" title="Tag: ninja" rel="tag">ninja</a>&nbsp;
    
        <!--a href="/tag/#mingw" title="Tag: mingw" rel="tag">mingw</a-->
        <a href="/cn/tag/#mingw" title="Tag: mingw" rel="tag">mingw</a>&nbsp;
    
        <!--a href="/tag/#msys" title="Tag: msys" rel="tag">msys</a-->
        <a href="/cn/tag/#msys" title="Tag: msys" rel="tag">msys</a>
    
  

</span>

            </div>

        </div>
        <hr>
        <article itemscope itemtype="http://schema.org/BlogPosting">
        <p>最近对xmake内部做了不少的重构来改进，并且新增了不少实用的新特性，欢迎来体验。</p>

<ul>
  <li><a href="https://github.com/xmake-io/xmake">项目源码</a></li>
  <li><a href="https://xmake.io/#/zh-cn/">官方文档</a></li>
</ul>

<p>一些新特性：</p>

<ol>
  <li>一键编译其他构建系统维护的项目，实现无缝对接，并且支持交叉编译（比如autotools的快速交叉编译，见下文详述）</li>
  <li>新增<code class="highlighter-rouge">xmake project -k ninja</code>工程生成插件，支持对build.ninja构建系统文件的生成</li>
</ol>

<p>一些改进点：</p>

<ol>
  <li>改进命令行参数输入，支持*nix style的参数输入，感谢<a href="https://github.com/OpportunityLiu">@OpportunityLiu</a>的贡献</li>
  <li>改进tab命令补全，增加对参数values的命令补全支持</li>
  <li>优化get.sh安装和xmake update更新脚本，添加国内镜像源，加速下载和安装更新</li>
  <li>gcc/clang编译错误输出支持原生色彩高亮支持</li>
  <li>新增msys/cygwin平台，并且xmake源码也支持msys/mingw平台编译</li>
</ol>

<p>一些看不见的改进点：</p>

<ol>
  <li>添加socket, pipe模块，改进process模块</li>
  <li>重构整个进程调度器，更好的调度并行构建</li>
  <li>重构改进整个coroutine协程模块，支持对socket/pipe/process三者的同时调度支持（为后续远程编译和分布式编译做准备）</li>
</ol>

<p>还有一些零散的bug修复，见下文更新内容。</p>

<h2 id="新特性介绍">新特性介绍</h2>

<h3 id="生成buildninja构建文件">生成build.ninja构建文件</h3>

<p>xmake现已支持对ninja构建文件的生成，让用户可以使用ninja来快速构建xmake维护的项目。不得不承认，目前就构建速度来讲，ninja确实比xmake快不少，后续版本我会尝试优化下xmake的构建速度。</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake project -k ninja
</code></pre>
</div>

<p>然后调用ninja来构建：</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>ninja
</code></pre>
</div>

<p>或者直接使用xmake命令来调用ninja构建，见下文。</p>

<h3 id="尝试使用其他构建系统构建">尝试使用其他构建系统构建</h3>

<p>xmake v2.3.1以上版本直接对接了其他第三方构建系统，即使其他项目中没有使用xmake.lua来维护，xmake也可以直接调用其他构建工具来完成编译。</p>

<p>那用户直接调用使用第三方构建工具来编译不就行了，为啥还要用xmake去调用呢？主要有以下好处：</p>

<ol>
  <li>完全的行为一致，简化编译流程，不管用了哪个其他构建系统，都只需要执行xmake这个命令就可以编译，用户不再需要去研究其他工具的不同的编译流程</li>
  <li>完全对接<code class="highlighter-rouge">xmake config</code>的配置环境，复用xmake的平台探测和sdk环境检测，简化平台配置</li>
  <li>对接交叉编译环境，即使是用autotools维护的项目，也能通过xmake快速实现交叉编译</li>
</ol>

<p>目前已支持的构建系统：</p>

<ul>
  <li>autotools（已完全对接xmake的交叉编译环境）</li>
  <li>xcodebuild</li>
  <li>cmake</li>
  <li>make</li>
  <li>msbuild</li>
  <li>scons</li>
  <li>meson</li>
  <li>bazel</li>
  <li>ndkbuild</li>
  <li>ninja</li>
</ul>

<h4 id="自动探测构建系统并编译">自动探测构建系统并编译</h4>

<p>例如，对于一个使用cmake维护的项目，直接在项目根目录执行xmake，就会自动触发探测机制，检测到CMakeLists.txt，然后提示用户是否需要使用cmake来继续完成编译。</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake 
note: CMakeLists.txt found, try building it <span class="o">(</span>pass -y or --confirm<span class="o">=</span>y/n/d to skip confirm<span class="o">)</span>?
please input: y <span class="o">(</span>y/n<span class="o">)</span>
-- Symbol prefix:
-- Configuring <span class="k">done</span>
-- Generating <span class="k">done</span>
-- Build files have been written to: /Users/ruki/Downloads/libpng-1.6.35/build
<span class="o">[</span>  7%] Built target png-fix-itxt
<span class="o">[</span> 21%] Built target genfiles
<span class="o">[</span> 81%] Built target png
<span class="o">[</span> 83%] Built target png_static
...
output to /Users/ruki/Downloads/libpng-1.6.35/build/artifacts
build ok!
</code></pre>
</div>

<h4 id="无缝对接xmake命令">无缝对接xmake命令</h4>

<p>目前支持<code class="highlighter-rouge">xmake clean</code>, <code class="highlighter-rouge">xmake --rebuild</code>和<code class="highlighter-rouge">xmake config</code>等常用命令与第三方系统的无缝对接。</p>

<p>我们可以直接清理cmake维护项目的编译输出文件</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake clean
<span class="gp">$ </span>xmake clean --all
</code></pre>
</div>

<p>如果带上<code class="highlighter-rouge">--all</code>执行清理，会清除autotools/cmake生成的所有文件，不仅仅只清理对象文件。</p>

<p>默认<code class="highlighter-rouge">xmake</code>对接的是增量构建行为，不过我们也可以强制快速重建：</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake --rebuild
</code></pre>
</div>

<h4 id="手动切换指定构建系统">手动切换指定构建系统</h4>

<p>如果一个项目下有多个构建系统同时在维护，比如libpng项目，自带autotools/cmake/makefile等构建系统维护，xmake默认优先探测使用了autotools，如果想要强制切换其他构建系统，可以执行：</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake f --trybuild<span class="o">=[</span>autotools|cmake|make|msbuild| ..]
<span class="gp">$ </span>xmake
</code></pre>
</div>

<p>另外，配置了<code class="highlighter-rouge">--trybuild=</code>参数手动指定了默认的构建系统，后续的build过程就不会额外提示用户选择了。</p>

<h4 id="实现快速交叉编译">实现快速交叉编译</h4>

<p>众所周知，autotools维护的项目虽然很多都支持交叉编译，但是交叉编译的配置过程很复杂，不同的工具链处理方式还有很多的差异，中途会踩到很多的坑。</p>

<p>即使跑通了一个工具链的交叉编译，如果切到另外一个工具链环境，可能又要折腾好久，而如果使用xmake，通常只需要两条简单的命令即可：</p>

<p>!&gt; 目前就autotools对接支持了xmake的交叉编译，后期还会对cmake等其他构建系统加上支持。</p>

<h5 id="交叉编译android平台">交叉编译android平台</h5>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake f -p android --trybuild<span class="o">=</span>autotools <span class="o">[</span>--ndk<span class="o">=</span>xxx]
<span class="gp">$ </span>xmake
</code></pre>
</div>

<p>!&gt; 其中，–ndk参数配置是可选的，如果用户设置了ANDROID_NDK_HOME环境变量，或者ndk放置在~/Library/Android/sdk/ndk-bundle，xmake都能自动检测到。</p>

<p>是不是很简单？如果你觉得这没啥，那么可以对比下直接操作<code class="highlighter-rouge">./configure</code>去配置交叉编译，可以看下这篇文档对比下：<a href="https://developer.android.com/ndk/guides/other_build_systems#autoconf">将NDK 与其他编译系统配合使用</a></p>

<p>说白了，你大概得这样，还不一定一次就能搞定：</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span><span class="nb">export </span><span class="nv">TOOLCHAIN</span><span class="o">=</span><span class="nv">$NDK</span>/toolchains/llvm/prebuilt/<span class="nv">$HOST_TAG</span>
<span class="gp">$ </span><span class="nb">export </span><span class="nv">AR</span><span class="o">=</span><span class="nv">$TOOLCHAIN</span>/bin/aarch64-linux-android-ar
<span class="gp">$ </span><span class="nb">export </span><span class="nv">AS</span><span class="o">=</span><span class="nv">$TOOLCHAIN</span>/bin/aarch64-linux-android-as
<span class="gp">$ </span><span class="nb">export </span><span class="nv">CC</span><span class="o">=</span><span class="nv">$TOOLCHAIN</span>/bin/aarch64-linux-android21-clang
<span class="gp">$ </span><span class="nb">export </span><span class="nv">CXX</span><span class="o">=</span><span class="nv">$TOOLCHAIN</span>/bin/aarch64-linux-android21-clang++
<span class="gp">$ </span><span class="nb">export </span><span class="nv">LD</span><span class="o">=</span><span class="nv">$TOOLCHAIN</span>/bin/aarch64-linux-android-ld
<span class="gp">$ </span><span class="nb">export </span><span class="nv">RANLIB</span><span class="o">=</span><span class="nv">$TOOLCHAIN</span>/bin/aarch64-linux-android-ranlib
<span class="gp">$ </span><span class="nb">export </span><span class="nv">STRIP</span><span class="o">=</span><span class="nv">$TOOLCHAIN</span>/bin/aarch64-linux-android-strip
<span class="gp">$ </span>./configure --host aarch64-linux-android
<span class="gp">$ </span>make
</code></pre>
</div>

<h5 id="交叉编译iphoneos平台">交叉编译iphoneos平台</h5>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake f -p iphoneos --trybuild<span class="o">=</span>autotools
<span class="gp">$ </span>xmake
</code></pre>
</div>

<h5 id="交叉编译mingw平台">交叉编译mingw平台</h5>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake f -p mingw --trybuild<span class="o">=</span>autotools <span class="o">[</span>--mingw<span class="o">=</span>xxx]
<span class="gp">$ </span>xmake
</code></pre>
</div>

<h5 id="使用其他交叉编译工具链">使用其他交叉编译工具链</h5>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake f -p cross --trybuild<span class="o">=</span>autotools --sdk<span class="o">=</span>/xxxx
<span class="gp">$ </span>xmake
</code></pre>
</div>

<p>关于更多交叉编译的配置细节，请参考文档：<a href="https://xmake.io/#/zh-cn/guide/configuration?id=%e4%ba%a4%e5%8f%89%e7%bc%96%e8%af%91">交叉编译</a>，除了多了一个<code class="highlighter-rouge">--trybuild=</code>参数，其他交叉编译配置参数都是完全通用的。</p>

<h4 id="传递用户配置参数">传递用户配置参数</h4>

<p>我们可以通过<code class="highlighter-rouge">--tryconfigs=</code>来传递用户额外的配置参数到对应的第三方构建系统，比如：autotools会传递给<code class="highlighter-rouge">./configure</code>，cmake会传递给<code class="highlighter-rouge">cmake</code>命令。</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake f --trybuild<span class="o">=</span>autotools --tryconfigs<span class="o">=</span><span class="s2">"--enable-shared=no"</span>
<span class="gp">$ </span>xmake
</code></pre>
</div>

<p>比如上述命令，传递<code class="highlighter-rouge">--enable-shared=no</code>给<code class="highlighter-rouge">./configure</code>，来禁用动态库编译。</p>

<p>另外，对于<code class="highlighter-rouge">--cflags</code>, <code class="highlighter-rouge">--includedirs</code>和<code class="highlighter-rouge">--ldflags</code>等参数，不需要通过<code class="highlighter-rouge">--tryconfigs</code>，通过<code class="highlighter-rouge">xmake config --cflags=</code>等内置参数就可透传过去。</p>

<h4 id="编译其他构建系统过程示例">编译其他构建系统过程示例</h4>

<h5 id="通用编译方式">通用编译方式</h5>

<p>大多数情况下，每个构建系统对接后的编译方式都是一致的，除了<code class="highlighter-rouge">--trybuild=</code>配置参数除外。</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake f --trybuild<span class="o">=[</span>autotools|cmake|meson|ninja|bazel|make|msbuild|xcodebuild]
<span class="gp">$ </span>xmake
</code></pre>
</div>

<p>!&gt; 我们还需要确保–trybuild指定的构建工具已经安装能够正常使用。</p>

<h5 id="构建android-jni程序">构建Android jni程序</h5>

<p>如果当前项目下存在<code class="highlighter-rouge">jni/Android.mk</code>，那么xmake可以直接调用ndk-build来构建jni库。</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake f -p android --trybuild<span class="o">=</span>ndkbuild <span class="o">[</span>--ndk<span class="o">=]</span>
<span class="gp">$ </span>xmake
</code></pre>
</div>

<h3 id="nix-style命令参数输入">*nix style命令参数输入</h3>

<p>目前的输入规范参考自：<a href="https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html">https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html</a></p>

<p>也非常感谢<a href="https://github.com/OpportunityLiu">@OpportunityLiu</a>的贡献，现在的输入方式，可以支持采用如下写法：</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake -j8 -rvD
</code></pre>
</div>

<p>之前只能这么写：</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake -j 8 -r -v -D
</code></pre>
</div>

<h3 id="tab命令自动补全">tab命令自动补全</h3>

<p>之前的版本，只能对参数名进行补全，现在可以对参数值进行补全和值列表提示，比如敲如下命令后：</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake f --plat<span class="o">=</span>and
</code></pre>
</div>

<p>按tab键就可以补全platform参数，变成</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code><span class="gp">$ </span>xmake f --plat<span class="o">=</span>android
</code></pre>
</div>

<h3 id="强制将c代码作为c编译">强制将c代码作为c++编译</h3>

<p>xmake新增一个配置参数，可以指定源文件的类型，强制作为对应的源文件来编译，比如将c代码作为c++来编译。</p>

<div class="language-lua highlighter-rouge"><pre class="highlight"><code><span class="n">target</span><span class="p">(</span><span class="s2">"test"</span><span class="p">)</span>
    <span class="n">set_kind</span><span class="p">(</span><span class="s2">"binary"</span><span class="p">)</span>
    <span class="n">add_files</span><span class="p">(</span><span class="s2">"src/*.c"</span><span class="p">,</span> <span class="p">{</span><span class="n">sourcekind</span> <span class="o">=</span> <span class="s2">"cxx"</span><span class="p">})</span>
</code></pre>
</div>

<h2 id="更新内容">更新内容</h2>

<h3 id="新特性">新特性</h3>

<ul>
  <li><a href="https://github.com/xmake-io/xmake/issues/675">#675</a>: 支持通过设置强制将<code class="highlighter-rouge">*.c</code>作为c++代码编译, <code class="highlighter-rouge">add_files("*.c", {sourcekind = "cxx"})</code>。</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/681">#681</a>: 支持在msys/cygwin上编译xmake，以及添加msys/cygwin编译平台</li>
  <li>添加socket/pipe模块，并且支持在协程中同时调度process/socket/pipe</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/192">#192</a>: 尝试构建带有第三方构建系统的项目，还支持autotools项目的交叉编译</li>
  <li>启用gcc/clang的编译错误色彩高亮输出</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/588">#588</a>: 改进工程生成插件<code class="highlighter-rouge">xmake project -k ninja</code>，增加对build.ninja生成支持</li>
</ul>

<h3 id="改进">改进</h3>

<ul>
  <li><a href="https://github.com/xmake-io/xmake/issues/665">#665</a>: 支持 *nix style 的参数输入，感谢<a href="https://github.com/OpportunityLiu">@OpportunityLiu</a>的贡献</li>
  <li><a href="https://github.com/xmake-io/xmake/pull/673">#673</a>: 改进tab命令补全，增加对参数values的补全支持</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/680">#680</a>: 优化get.sh安装脚本，添加国内镜像源，加速下载</li>
  <li>改进process调度器</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/651">#651</a>: 改进os/io模块系统操作错误提示</li>
</ul>

<h3 id="bugs修复">Bugs修复</h3>

<ul>
  <li>修复增量编译检测依赖文件的一些问题</li>
  <li>修复log输出导致xmake-vscode插件解析编译错误信息失败问题</li>
  <li><a href="https://github.com/xmake-io/xmake/issues/684">#684</a>: 修复windows下android ndk的一些linker错误</li>
</ul>

        </article>
        <hr>

        <!-- baidu ads -->
        

        <!-- reward -->
        <div style="text-align: center;">
            <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
              <span>赏</span>
            </button>
            <div id="QR" style="display: none;">
                <div id="wechat" style="display: inline-block">
                  <img id="wechat_qr" src="/static/img/weixin.png" alt="WeChat Pay"/>
                  <p>微信打赏</p>
                </div>
                <div id="alipay" style="display: inline-block">
                  <img id="alipay_qr" src="/static/img/alipay.png" alt="Alipay"/>
                  <p>支付宝打赏</p>
                </div>
            </div>
        </div>

        
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
                    
                    <h2 id="english">English</h2>
                    <ul>
                    
                    <li class="relatedPost">
                        <a href="/2020/02/23/xmake-update-v2.3.1/">xmake v2.3.1 released, Seamless integration with other build systems
                        
                        </a>
                    </li>
                    
                    
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
            
            
                
            
        
            
        
        
            </ul>
        

        
        
            
        
            
            
            
                
                    
                        
                        <h2 id="similar_posts">相关文章</h2>
                        <ul>
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/12/17/xmake-update-v2.6.2/">xmake v2.6.2 发布，新增 Linux 内核驱动模块构建支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/12/03/xmake-update-v2.6.1/">xmake v2.6.1 发布，使用 Lua5.4 运行时，Rust 和 C++ 混合编译支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/10/30/xmake-update-v2.5.9/">xmake v2.5.9 发布，改进 C++20 模块，并支持 Nim, Keil MDK 和 Unity Build
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/10/08/xmake-update-v2.5.8/">xmake v2.5.8 发布，新增 Pascal/Swig 程序和 Lua53 运行时支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
            
        
            
            
            
                
                    
                        
                        <li class="relatedPost">
                            <a href="/cn/2021/08/29/xmake-update-v2.5.7/">xmake v2.5.7 发布，包依赖锁定和 Vala/Metal 语言编译支持
                            
                            </a>
                        </li>
                        
                        
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            
        
        
            </ul>
        

        <div class="post-recent">
    <div class="pre">

        

        

        
        
        <p><strong>上一篇</strong> <a href="/cn/2019/12/31/tboox-now-and-future/">TBOOX开源工程2019总结和明年规划</a></p>
        
    </div>

    <div class="nex">

        

        

        
        
        

        

        

        
        
        <p><strong>下一篇</strong> <a href="/cn/2020/02/29/update-v1.6.5/">tbox v1.6.5 发布，改进协程调度支持</a></p>
        
    </div>
</div>


        <h2 id="comments">评论</h2>
        






<div id="gitalk-container"></div>
<link rel="stylesheet" href="/css/gitalk.css">
<script src="/js/gitalk.min.js"></script>

<script>
const gitalk = new Gitalk({
  clientID: '73946dc1d9e2276ad0da',
  clientSecret: '12a3cb94361ba3ebc6ecb68cf80d592bfaa8106d',
  repo: 'tboox.github.io',
  owner: 'waruqi',
  admin: ['waruqi'],
  id: location.pathname,       
  language: 'zh-CN',
  distractionFreeMode: false  
})

gitalk.render('gitalk-container')
</script>





    </div>
    <button class="anchor"><i class="fa fa-anchor"></i></button>
    <div class="right">
        <div class="wrap">

            <!-- codefund ads -->
            

            <!-- Content -->
            <div class="side content">
                <div>
                    内容
                </div>
                <ul id="content-side" class="content-ul">
                    <li><a href="#english">English</a></li>
                    <li><a href="#similar_posts">相关文章</a></li>
                    <li><a href="#comments">评论</a></li>
                </ul>
            </div>


            <!-- baidu ads -->
            
            
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    链接
                </div>
                <ul class="content-ul">
                  <li><a href="http://github.com/waruqi/tbox">tbox</a></li>
                  <li><a href="http://www.xmake.io">xmake</a></li>
                  <li><a href="https://github.com/waruqi">github</a></li>
                </ul>
            </div> 

            <!-- xmake courses -->
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    xmake 入门课程
                </div>
                <a href="https://xmake.io/#/zh-cn/about/course" target="_blank">
                <img src="/static/img/xmake-course.png" alt="course" width="256" height="193">
                </a>
            </div>

            <!-- qqgroup -->
            <br>
            <div class="side">
                <div>
                    <i class="fa fa-external-link"></i>
                    技术交流群（QQ）
                </div>
                <img src="/static/img/qqgroup.png" alt="qqgroup" width="256" height="284">
            </div> 

            <!-- google ads -->
            

            <!-- baidu ads -->
            

        </div>
    </div>

    <!-- baidu ads -->
    
</div>
<script>
/**
 * target _blank
 */
(function() {
    var aTags = document.querySelectorAll('article a:not([id])')
    for (var i = 0; i < aTags.length; i++) {
        aTags[i].setAttribute('target', '_blank')
    }
}());
</script>
<script src="/js/pageContent.js " charset="utf-8"></script>



    <footer class="site-footer">
    <div class="wrapper">
        <p class="description">
             Copyright (c) 2016-2020 tboox.org 
        </p>
        <p class="contact">
            
            <a href="https://github.com/waruqi" title="GitHub"><i class="fa fa-github" aria-hidden="true"></i></a> 
             
            
            <a href="mailto:waruqi@gmail.com" title="email"><i class="fa fa-envelope-o" aria-hidden="true"></i></a> 
            
            
            <a href="https://twitter.com/waruqi" title="Twitter"><i class="fa fa-twitter" aria-hidden="true"></i></a> 
            
            <a href="/feed.xml" title="feed"><i class="fa fa-feed" aria-hidden="true"></i></a> 
        </p>
        <p class="power">
            <span>
                Site powered by <a href="https://jekyllrb.com/">Jekyll</a> & <a href="https://github.com/Gaohaoyang">HyG</a> & <a href="https://pages.github.com/">Github Pages</a>.
            </span>
        </p>
    </div>
</footer>

    <div class="back-to-top">
    <a href="#top" class="scroll">
        <i class="fa fa-arrow-up" aria-hidden="true"></i>
    </a>
</div>

    <script src=" /js/main.js " charset="utf-8"></script>
    <script src=" /js/scroll.min.js " charset="utf-8"></script>
  </body>

</html>
